<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>帮帮网</title>
<link href="../default.css" media="screen" rel="stylesheet" />
<link href="CSS/formStyle.css" rel="stylesheet"  type="text/css" />
<link href="../CSS/kakassiStyle.css" rel="stylesheet"  type="text/css" />
<script src="../JS/jquery-1.3.2.min.js" type="text/javascript"></script>
<script type="text/javascript"  src="../JS/prototype.js"></script>
<script type="text/javascript" src="../JS/httpRequest.js"></script>
<script type="text/javascript" src="../JS/cookie.js"></script>
<script type="text/javascript">

$(document).ready(function(){ 
	


	$("#left_bar ul li").hover(
		function(){
			$(this).addClass("selector_on");
			$(this).removeClass("selector_off");
			//todo 抽出关注度最高的十个人 悬浮于右侧
		},
		function(){
			$(this).addClass("selector_off");
			$(this).removeClass("selector_on");
			//todo 取消显示右侧的人名
		}
	);

});  

function showFriends()
{

	username=getCookie('username');
	userID = getCookie('userID');

	var url="friend.php?action=friendList";
	var para="foid="+userID;
	var resp=SendPostRequest(url,para);

	var friendListDiv=document.getElementById('friendListDiv');
	//刷新前 先清空子节点
	var childs = friendListDiv.childNodes;
	for(var i=childs.length-1; i>=0; i--){
		friendListDiv.removeChild(childs[i]);
	}
	friendListDiv.innerHTML="我关注的人";

	if(resp!=null && resp!="[]")
	{
		eval("frList="+resp);
		for(var i=0;i<frList.length;i++)
		{
			//标题
			var frDiv=document.createElement('div');
			frDiv.style.padding="10px";
			if(userID!=frList[i].frid)
			{
				frDiv.innerHTML="<font style='14px bold'><img width=50 height=50 src='../imgpick/uploads/"+frList[i].frid+"'/><a href=../hisSpace.htm?"+frList[i].frid+">"+frList[i].frname+"</a>  关注度："+frList[i].point+"</font>";	
			}
			else
			{
				frDiv.innerHTML="<font style='14px bold'><img width=50 height=50 src='../imgpick/uploads/"+frList[i].frid+"'/><a href=../myspace.htm>"+frList[i].frname+"</a>  关注度："+frList[i].point+"</font>";				
			}
			friendListDiv.appendChild(frDiv);
		}	
	}
	else 
	{
		friendListDiv.innerHTML+="  你居然还没有关注别人 赶紧关注一个吧";		
	}
}
</script>

</head>
<body onload="showFriends()">

<div id="all">
    <div id="header">
        <div id="inner_header" class="central_fixed_width">
		    <h1 class="logo">帮帮网</h1>
            <div id="user_status"><a href="../login.htm">登陆</a>||<a href="../register.html">注册</a></div>
            <ul id="nav_bar">
                <li><a href="../activity/activity.html"><span class="nav_item">活动</span></a></li>
                <li><a href="../index.html"><span class="nav_item">悬赏求助大厅</span></a></li>
                <li><a href="../myspace.html"><span class="nav_item">个人主页</span></a></li>
                <li><a href="#"><span class="nav_item">点评</span></a></li>
                <li><a href="#"><span class="nav_item">小说</span></a></li>
                <li class="clear"></li>
            </ul>
        </div>
    </div>
        
	<div id="content" class="central_fixed_width">

		<div id="left_bar">
			<ul>
                <a href="friend.htm" ><li class="selector_on">我关注的人</li></a>
				<a href="follower.htm" ><li class="selector_off">关注我的人</li></a>
            </ul>
		</div>

        <div class="main_column">
			<div id='friendListDiv' style="padding:20px;">

			</div>
			<div class="clear"></div>
		</div>




	
	</div>


    <div id="footer">
        <div id="inner_footer" class="central_fixed_width">


            <div class="footer_links">
                &copy; 2011 帮帮网 All rights reserved.
            </div>
            <div class="clear"></div>
            
        </div>
    </div>
</div>

</body>
</html>